import { createSlice } from "@reduxjs/toolkit";
// 创建
const channelSlice = createSlice({
  name: "channel",
  initialState: {
    channelList: [],
    currentChannel: null,
  },
  reducers: {
    setChannelList(state, action) { 
      state.channelList = action.payload;
    },
    setCurrentChannel(state, action) {
      state.currentChannel = action.payload;
    },
  },
});
export const { setChannelList, setCurrentChannel } = channelSlice.actions;

export default channelSlice.reducer ;
